// author by welong
// zuowl@qq.com
// 2014-09-04  14:28
// PAT basic 1009

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv)
{
	int  i, j, word_count, *pos;
	char input[81];

	gets(input);
	
	for(i = 0, word_count = 1; input[i] != 0; i++)
	{
		if(input[i] == ' ')
			word_count++;
	}

	//printf("word_count: %d\n", word_count);

	pos = (int*)malloc(sizeof(int) * (word_count + 1));
	j = 0;
	pos[j++] = -1;

	for(i = 0; input[i] != 0; i++)
	{
		if(input[i] == ' ')
			pos[j++] = i;
	}
	pos[j] = i;
	
	//for(i = 0; i < word_count; i++)
	//	printf("%d\n", pos[i]);

	for(i = 0; i < word_count; i++)
	{
		for(j = pos[word_count -1 -i] + 1; j < pos[word_count -i]; j++)
			printf("%c", input[j]);

		if(i != word_count-1)
			printf(" ");
	}

	return 0;
}